<!doctype html>
<html lang="zh-CN">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <!-- 新 Bootstrap4 核心 CSS 文件 -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/register.css">
  <style>
  </style>
  <title>校园网登录界面</title>
</head>

<body>
  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>

  <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

  <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

  <div class="container" style="padding: 10% 26%;">
    <h2 class="title">注册账号</h2>
    <form method="POST" action="/home/register">
      <div class="form-group">
        <!-- <label for="exampleInputEmail1">Username:</label> -->
        <input type="username" placeholder="Username:" class="form-control" name="username" id="exampleInputEmail1"
          aria-describedby="emailHelp">
      </div>
      <div class="form-group">
        <!-- <label for="exampleInputPassword1">Password:</label> -->
        <input type="password" placeholder="Password:" class="form-control" name="password" id="exampleInputPassword1">
      </div>
      <div class="form-group">
        <!-- <label for="exampleInputPassword1">Email:</label> -->
        <input type="email" placeholder="Email:" class="form-control" name="email" id="exampleInputEmail1">
      </div>

      <!-- 提示文字部分 -->
      <div class="form-gprou tishi text-right">
        <a class="text-decoration-none" id="link">已有账号,去登录</a>
      </div>

      <!-- 提交按钮 -->
      <div class="form-group" style="margin-top: 30px;">
        <input type="submit" class="form-control btn-primary" value="注册">
      </div>
    </form>
  </div>
</body>
<script>

  $('form').on('submit', function () {

    if ($('#exampleInputEmail1').val().trim().length == 0) {
      alert('账号不能为空')
      return false;
    }
    if ($('#exampleInputPassword1').val().trim().length == 0) {
      alert('密码不能为空')
      return false;
    }
    if ($('#exampleInputEmail1').val().trim().length == 0) {
      alert('邮箱不能为空')
      return false;
    }
  })

  $('#link').on('click', function () {
    window.location.href = '/home/login'
  })
</script>

</html>